import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MemberUserFeedbackVO, MemberUserFeedbackForm, MemberUserFeedbackQuery } from '@/api/member/memberUserFeedback/types';

/**
 * 查询用户反馈列表
 * @param query
 * @returns {*}
 */

export const listMemberUserFeedback = (query?: MemberUserFeedbackQuery): AxiosPromise<MemberUserFeedbackVO[]> => {
  return request({
    url: '/member/memberUserFeedback/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户反馈详细
 * @param feedbackId
 */
export const getMemberUserFeedback = (feedbackId: string | number): AxiosPromise<MemberUserFeedbackVO> => {
  return request({
    url: '/member/memberUserFeedback/' + feedbackId,
    method: 'get'
  });
};

/**
 * 新增用户反馈
 * @param data
 */
export const addMemberUserFeedback = (data: MemberUserFeedbackForm) => {
  return request({
    url: '/member/memberUserFeedback',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户反馈
 * @param data
 */
export const updateMemberUserFeedback = (data: MemberUserFeedbackForm) => {
  return request({
    url: '/member/memberUserFeedback',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户反馈
 * @param feedbackId
 */
export const delMemberUserFeedback = (feedbackId: string | number | Array<string | number>) => {
  return request({
    url: '/member/memberUserFeedback/' + feedbackId,
    method: 'delete'
  });
};
